<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>示例（级联菜单）</title>
<link id="easyuiTheme" rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/assets/ui/jquery-easyui-1.4.1/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/assets/ui/jquery-easyui-1.4.1/themes/icon.css">
<script type="text/javascript"
	src="<%=request.getContextPath()%>/assets/ui/jquery-easyui-1.4.1/jquery.min.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/assets/ui/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/assets/ui/jquery-easyui-1.4.1/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
	<a href="../demo.jsp">返回</a>
	<div class="easyui-panel" data-options="title:'级联菜单',width:700,height:300" style="padding: 10px">
		省：<input id="province" class="easyui-combobox"/>
		市：<input id="city" class="easyui-combobox"/>
		县（区）：<input id="county" class="easyui-combobox"/>
	</div>
</body>
<script type="text/javascript">
	$(document).ready(function() {
		$("#province").combobox({
			valueField : 'subType',
			textField : 'oname',
			mode : 'remote',
			url : '<%=request.getContextPath()%>/LovController/findDictListByDictType.do?dictType=province',
			onSelect : function(record){
				$("#city").combobox('clear');
				$("#county").combobox('clear');
				var getCityUrl = '<%=request.getContextPath()%>/LovController/findDictListByDictType.do?dictType=' + record.subType;
				$("#city").combobox('reload',getCityUrl);
				var getCountyUrl = '<%=request.getContextPath()%>/LovController/findDictListByDictType.do?dictType=none';
				$("#county").combobox('reload',getCountyUrl);
			}
		});
		$("#city").combobox({
			valueField : 'subType',
			textField : 'oname',
			mode : 'remote',
			onSelect : function(record){
				$("#county").combobox('clear');
				var getCountyUrl = '<%=request.getContextPath()%>/LovController/findDictListByDictType.do?dictType=' + record.subType;
				$("#county").combobox('reload',getCountyUrl);
			}
		});
		$("#county").combobox({
			valueField : 'subType',
			textField : 'oname',
			mode : 'remote'
		});
	});
</script>
</html>